package com.ycsd.invest.order.business.formplugin;

import kd.bos.form.control.Button;
import kd.bos.form.control.Control;
import kd.bos.form.plugin.AbstractFormPlugin;

import java.util.EventObject;

public class OrderInfoUpForm extends AbstractFormPlugin {


    @Override
    public void registerListener(EventObject e) {
        // 按钮点击
        Button btnok = this.getView().getControl("btnok");
        btnok.addClickListener(this);
        Button btncancel = this.getView().getControl("btncancel");
        btncancel.addClickListener(this);
    }

    @Override
    public void click(EventObject evt) {
        String key = ((Control) evt.getSource()).getKey();
        if("btnok".equals(key)){
            // 取得文本字段的值，返回给父页面
            Object value = this.getModel().getValue("suggestion");
            this.getView().returnDataToParent(value);
            // 关闭子页面，会自动触发父页面的closedCallBack方法
            this.getView().close();
        }
    }
}